/*
import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.generator.config.DataSourceConfig;
import com.baomidou.mybatisplus.generator.config.GlobalConfig;
import com.baomidou.mybatisplus.generator.config.PackageConfig;
import com.baomidou.mybatisplus.generator.config.StrategyConfig;
import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;

public class AutoGenerator {
    public static void main(String[] args) {
        // genernateModel();
    }

    public static void genernateModel(){
        //创建autoGenerator
        com.baomidou.mybatisplus.generator.AutoGenerator autoGenerator = new com.baomidou.mybatisplus.generator.AutoGenerator();
        //数据源
        DataSourceConfig dataSourceConfig = new DataSourceConfig();
        //选用数据库
        dataSourceConfig.setDbType(DbType.MYSQL);
        //设置数据库连接
        dataSourceConfig.setUrl("jdbc:mysql://localhost:3306/chat_system?useUnicode=true&characterEncoding=UTF-8");
        //设置用户名
        dataSourceConfig.setUsername("root");
        //设置密码
        dataSourceConfig.setPassword("1234");
        //设置数据库驱动
        dataSourceConfig.setDriverName("com.mysql.jdbc.Driver");
        //装填数据源
        autoGenerator.setDataSource(dataSourceConfig);
        //全局配置
        GlobalConfig globalConfig = new GlobalConfig();
        //获取工程绝对路径
        globalConfig.setOutputDir(System.getProperty("user.dir")+"/src/main/java");
        //关闭文件夹
        globalConfig.setOpen(false);
        //设置作者
        globalConfig.setAuthor("XTC");

        globalConfig.setServiceName("%sService");
        autoGenerator.setGlobalConfig(globalConfig);
        //包信息
        PackageConfig packageConfig = new PackageConfig();
        //存放路径
        packageConfig.setParent("com");
        //设置模块名
        packageConfig.setModuleName("generator");
        //设置controller
        packageConfig.setController("controller");
        packageConfig.setService("service");
        packageConfig.setServiceImpl("service.impl");
        packageConfig.setMapper("mapper");
        packageConfig.setEntity("entity");
        autoGenerator.setPackageInfo(packageConfig);
        //配置策略
        StrategyConfig strategyConfig = new StrategyConfig();
        //指定需要将哪些表生成实体类
        strategyConfig.setInclude(new String[] {
//            "chat_record",
//            "friend",
//            "friend_apply",
//            "group",
//            "group_apply",
//            "group_user",
//            "twitter",
//            "user",
                "twitter_picture"
        });
        //自动添加lombokmodel注解,
        strategyConfig.setEntityLombokModel(true);
        //设置驼峰名命
        strategyConfig.setNaming(NamingStrategy.underline_to_camel);

        strategyConfig.setColumnNaming(NamingStrategy.underline_to_camel);
        //strategyConfig.setTablePrefix(packageConfig.getModuleName() + "tb_");//设置去除表的前缀 strategy.setTablePrefix("tb","TB")
        autoGenerator.setStrategy(strategyConfig);

        autoGenerator.execute();
    }
}
*/
